fix(cli,gen): redirect tracing to stderr and add LocalGPT label on responses#52
Merged
Merged
Conversation
Contributor
|
@copilot make sure gen mode cli also have the same fix, refactor to use same code between those 2 cli as much as possible |
…ing to stderr Co-authored-by: yiwang <142937+yiwang@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix formatting issues in localgpt CLI output
fix(cli): redirect tracing to stderr and add LocalGPT label on tool follow-up responses
Feb 19, 2026
Co-authored-by: yiwang <142937+yiwang@users.noreply.github.com>
Contributor
Author
Done in commit
|
Copilot
AI
changed the title
fix(cli): redirect tracing to stderr and add LocalGPT label on tool follow-up responses
fix(cli,gen): redirect tracing to stderr and add LocalGPT label on responses
Feb 19, 2026
yiwang
approved these changes
Feb 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tracing output was written to stdout, causing log lines to interleave with streamed model output mid-line. Additionally, model responses were missing the
LocalGPT:label and leading newline in both the chat CLI and gen CLI.Changes
crates/cli/src/main.rs— Added.with_writer(std::io::stderr)to both tracing subscriber initializations (gen-mode andasync_main), routing all log output to stderr and away from the streamed stdout output.crates/cli/src/cli/chat.rs— Changed follow-up response print fromprint!("{}", follow_up)toprint!("\nLocalGPT: {}", follow_up), matching the label applied to the initial response and ensuring clean line separation after tool call output.crates/gen/src/main.rs— Applied the same fixes as the CLI: added.with_writer(std::io::stderr)to the tracing subscriber, and updated both responseprintln!calls to use theLocalGPT:label (println!("\nLocalGPT: {}\n", response)) for both the initial-prompt path and the interactive loop — consistent with the chat CLI.Original prompt
This pull request was created from Copilot chat.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.